Skip to content

Conversation

surechen
Copy link
Contributor

@surechen surechen commented Oct 9, 2024

For example:

let s = "123";
println!({}, "sss", s);

Suggest:
println!("{:?} {} {}", {}, "sss", s);

fixes #130170

@rustbot
Copy link
Collaborator

rustbot commented Oct 9, 2024

r? @Nadrieril

rustbot has assigned @Nadrieril.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 9, 2024
@surechen surechen force-pushed the fix_130495 branch 2 times, most recently from 689cf08 to c1771b9 Compare October 9, 2024 07:17
@surechen surechen requested a review from jieyouxu October 9, 2024 07:19
@Nadrieril
Copy link
Member

r? @jieyouxu

@rustbot rustbot assigned jieyouxu and unassigned Nadrieril Oct 12, 2024
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, some last minor nits then r=me.

@jieyouxu jieyouxu added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 12, 2024
… format macro.

For example:
```rust
let s = "123";
println!({}, "sss", s);
```
Suggest:
`println!("{:?} {} {}", {}, "sss", s);`

fixes rust-lang#130170
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, r=me after PR CI is green.

@surechen
Copy link
Contributor Author

Thanks, r=me after PR CI is green.

Done. Thank you.

@surechen surechen requested a review from jieyouxu October 14, 2024 08:10
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 14, 2024
@jieyouxu
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Oct 14, 2024

📌 Commit ceced53 has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 14, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 14, 2024
Special treatment empty tuple when suggest adding a string literal in format macro.

For example:
```rust
let s = "123";
println!({}, "sss", s);
```
Suggest:
`println!("{:?} {} {}", {}, "sss", s);`

fixes rust-lang#130170
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 14, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#129424 (Stabilize `Pin::as_deref_mut()`)
 - rust-lang#131332 (Fix clobber_abi and disallow SVE-related registers in Arm64EC inline assembly)
 - rust-lang#131384 (Update precondition tests (especially for zero-size access to null))
 - rust-lang#131430 (Special treatment empty tuple when suggest adding a string literal in format macro.)
 - rust-lang#131550 (Make some tweaks to extern block diagnostics)
 - rust-lang#131667 (Fix AArch64InlineAsmReg::emit)
 - rust-lang#131679 (compiletest: Document various parts of compiletest's `lib.rs`)
 - rust-lang#131682 (Tag PRs affecting compiletest with `A-compiletest`)

Failed merges:

 - rust-lang#131496 (Stabilise `const_make_ascii`.)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 14, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#129424 (Stabilize `Pin::as_deref_mut()`)
 - rust-lang#131332 (Fix clobber_abi and disallow SVE-related registers in Arm64EC inline assembly)
 - rust-lang#131384 (Update precondition tests (especially for zero-size access to null))
 - rust-lang#131430 (Special treatment empty tuple when suggest adding a string literal in format macro.)
 - rust-lang#131550 (Make some tweaks to extern block diagnostics)
 - rust-lang#131667 (Fix AArch64InlineAsmReg::emit)
 - rust-lang#131679 (compiletest: Document various parts of compiletest's `lib.rs`)
 - rust-lang#131682 (Tag PRs affecting compiletest with `A-compiletest`)

Failed merges:

 - rust-lang#131496 (Stabilise `const_make_ascii`.)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 75231f8 into rust-lang:master Oct 14, 2024
6 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Oct 14, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 14, 2024
Rollup merge of rust-lang#131430 - surechen:fix_130495, r=jieyouxu

Special treatment empty tuple when suggest adding a string literal in format macro.

For example:
```rust
let s = "123";
println!({}, "sss", s);
```
Suggest:
`println!("{:?} {} {}", {}, "sss", s);`

fixes rust-lang#130170
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

does not detect {} not being in quotes when looking for a string literal, instead offers an incorrect solution
5 participants